import router from "@/router";
import store from "@/store";

import NProgress from "nprogress";

router.beforeEach((to, from, next) => {
  // NProgress.start();
  document.title = to.meta.title || (window as any).VUE_APP_URL[import.meta.env.MODE].title;
  const token = store.state.user.token;
  // 免校验
  if (to.meta.needLogin===false) {
    return next();
  }
  next()
});

router.afterEach(() => {
  // NProgress.done();
});
